#ifndef _Shifter_H_
#define _Shifter_H_

#include "../bitarray/BitArray.h"
#include "../bitpointer/BitPointer.h"


/*
	class : Shifter
	desc : A relatively generic shifter
		It doesn't work in the same way 
		at the bit shifter and takes in a bitarray
		In other words it is a shifter of any width.
*/
class Shifter
{
	private :
		//creates an array bits
		BitArray array;
		//the pointer we shift bits into
		BitPointer bit;
		//the direction to shift values.
		bool direction;
		//Whether I'm getting in values or sending out values.
		bool io;
		//the current index in the array to get values or set values to
		unsigned int index;
		//returns if the shift has finished a word
		bool finished;
	public:
		//returns if shifter is finished
		bool getFinished();
		//gets the bit array I am shifting
		BitArray get();
		//sets the value of the bit array I am shifting
		void set(BitArray a);
		//constructor sets length of bit array the bit pointed to,
		//direction to shift, and whether it is input or output
		Shifter(unsigned int length, BitPointer& b, bool dir, bool i);
		//default constructor
		Shifter();
		//performs a shift with the shifter.
		void shift();

		
		
};

#endif
